package com.yaj.myfactorysupport.controller;


import com.yaj.myfactorysupport.dto.TSmtProcessDto;
import com.yaj.myfactorysupport.entity.TSmtProcess;
import com.yaj.myfactorysupport.service.TSmtProcessService;
import com.yaj.myfactorysupport.util.RespBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.math.BigDecimal;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wei
 * @since 2021-06-01
 */
@Api(tags = "TSmtProcessController")
@RestController
@RequestMapping("/myfactorysupport/t-smt-process")
public class TSmtProcessController {
    @Autowired
    private TSmtProcessService tSmtProcessService;

    @ApiOperation(value = "检索SMT进度管理情报")
    @GetMapping("/GetSMTProcessData")
    public RespBean GetSMTProcessData(String OrderNo, BigDecimal BrNo, String MounterID, String SMTSide){
        return tSmtProcessService.SelSMTProcess(OrderNo,BrNo,MounterID,SMTSide);
    }

    @ApiOperation(value = "登录SMT进度管理情报")
    @PostMapping("/RegSMTProcess")
    public RespBean RegSMTProcess(@RequestBody TSmtProcess tSmtProcess){
        return tSmtProcessService.RegSMTProcess(tSmtProcess);
    }

    @ApiOperation(value = "删除SMT进度管理情报")
    @PostMapping("/DelSMTProcess")
    public RespBean DelSMTProcess(String OrderNo, BigDecimal BrNo, String MounterID, String SMTSide){
        return tSmtProcessService.DelSMTProcess(OrderNo,BrNo,MounterID,SMTSide);
    }

    @ApiOperation(value = "重置SMT配当")
    @PostMapping("/ResetSMTProcess")
    public RespBean ResetSMTProcess(@RequestBody TSmtProcessDto tSmtProcessDto){
        return tSmtProcessService.ResetSMTProcess(tSmtProcessDto);
    }
}

